from django.conf.urls.defaults import *
from django.conf import settings 
from django.contrib.auth import views as auth_views
from myblog.views import about, photo
from myblog.post.views import all_posts
from myblog.comment.views import create_comment, create_photo_comment, create_about_comment, delete_comment, delete_photo_comment, delete_about_comment
from myblog.picture.views import addPicture
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^myblog/', include('myblog.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/(.*)', admin.site.root),
    (r'^about/$',about ),
    (r'^$', all_posts),
    (r'^post/', include('post.urls')),
    (r'^comment/(?P<pid>\d+)$', create_comment),
    (r'^comment-photo/$', create_photo_comment),
    (r'^comment-about/$', create_about_comment),
    (r'^comment/(?P<id>\d+)/delete$', delete_comment),
    (r'^photo-comment/(?P<id>\d+)/delete$', delete_photo_comment),
    (r'^about-comment/(?P<id>\d+)/delete$', delete_about_comment),
    (r'^photo/$', photo),
    (r'^photo/upload/$', addPicture),
    (r'^tag/', include('taggle.urls')),
    url(r'^login/$',
        auth_views.login,
        {'template_name': 'auth/login.html'},
        name='auth_login'),
    url(r'^logout/$',
        auth_views.logout,
        {'template_name': 'registration/logout.html', 'next_page': '/'},
        name='auth_logout'),
)

urlpatterns += patterns('',
   (r'^site_media/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.STATIC_PATH}),
)
